%% List of algorithms to test
% This script creates the 'admm_algorithms' structure used by 'RunOnDataset.m'
% and 'SelectWeightsForDataset.m', and the 'demosaic_algorithms' and
% 'rgb_correction_algorithms' structures used by 'RunOnDataset.m'.

% ADMM family algorithms
admm_algorithms.spectralL1L1 = struct(...
    'name', 'Spectral L1L1',... % Pretty name for tables and graphs
    'file', 'L1L1',... % Short name for filenames
    'enabled', false,... % Whether or not to run the algorithm
    'spectral', true,... % Estimate spectral or colour images
    'priors', [true, true, false],... % Priors to enable (`false` means the corresponding weight will be zero)
    'options', struct('norms', [true, true, false], 'nonneg', false)... % Custom options for baek2017Algorithm2()
);
admm_algorithms.spectralL1L1NonNeg = struct(...
    'name', 'Spectral L1L1NonNeg',...
    'file', 'L1L1NonNeg',...
    'enabled', false,...
    'spectral', true,...
    'priors', [true, true, false],...
    'options', struct('norms', [true, true, false], 'nonneg', true)...
);
admm_algorithms.spectralL2L2 = struct(...
    'name', 'Spectral L2L2',...
    'file', 'L2L2',...
    'enabled', false,...
    'spectral', true,...
    'priors', [true, true, false],...
    'options', struct('norms', [false, false, false], 'nonneg', false)...
);
admm_algorithms.spectralL2L2NonNeg = struct(...
    'name', 'Spectral L2L2NonNeg',...
    'file', 'L2L2NonNeg',...
    'enabled', false,...
    'spectral', true,...
    'priors', [true, true, false],...
    'options', struct('norms', [false, false, false], 'nonneg', true)...
);
admm_algorithms.spectralL1NonNeg = struct(...
    'name', 'Spectral L1NonNeg',...
    'file', 'L1NonNeg',...
    'enabled', false,...
    'spectral', true,...
    'priors', [true, false, false],...
    'options', struct('norms', [true, false, false], 'nonneg', true)...
);
admm_algorithms.spectralL1 = struct(...
    'name', 'Spectral L1',...
    'file', 'L1',...
    'enabled', false,...
    'spectral', true,...
    'priors', [true, false, false],...
    'options', struct('norms', [true, false, false], 'nonneg', false)...
);
admm_algorithms.spectralL2NonNeg = struct(...
    'name', 'Spectral L2NonNeg',...
    'file', 'L2NonNeg',...
    'enabled', false,...
    'spectral', true,...
    'priors', [true, false, false],...
    'options', struct('norms', [false, false, false], 'nonneg', true)...
);
admm_algorithms.spectralL2 = struct(...
    'name', 'Spectral L2',...
    'file', 'L2',...
    'enabled', false,...
    'spectral', true,...
    'priors', [true, false, false],...
    'options', struct('norms', [false, false, false], 'nonneg', false)...
);
admm_algorithms.spectralL1SpatialLap2NonNeg = struct(...
    'name', 'Spectral L1SpatialLap2NonNeg',...
    'file', 'L1SpatialLap2NonNeg',...
    'enabled', true,...
    'spectral', true,...
    'priors', [true, false, true],...
    'options', struct('norms', [true, true, false], 'nonneg', true)...
);
admm_algorithms.spectralL1SpectralLap2NonNeg = struct(...
    'name', 'Spectral L1SpectralLap2NonNeg',...
    'file', 'L1SpectralLap2NonNeg',...
    'enabled', false,...
    'spectral', true,...
    'priors', [false, true, true],...
    'options', struct('norms', [true, true, false], 'nonneg', true)...
);
admm_algorithms.spectralLap1NonNeg = struct(...
    'name', 'Spectral Lap1NonNeg',...
    'file', 'Lap1NonNeg',...
    'enabled', true,...
    'spectral', true,...
    'priors', [false, false, true],...
    'options', struct('norms', [true, false, true], 'nonneg', true)...
);
admm_algorithms.spectralLap2NonNeg = struct(...
    'name', 'Spectral Lap2NonNeg',...
    'file', 'Lap2NonNeg',...
    'enabled', true,...
    'spectral', true,...
    'priors', [false, false, true],...
    'options', struct('norms', [true, false, false], 'nonneg', true)...
);
admm_algorithms.spectralL1SpatialLap2 = struct(...
    'name', 'Spectral L1SpatialLap2',...
    'file', 'L1SpatialLap2',...
    'enabled', false,...
    'spectral', true,...
    'priors', [true, false, true],...
    'options', struct('norms', [true, true, false], 'nonneg', false)...
);
admm_algorithms.spectralL1SpectralLap2 = struct(...
    'name', 'Spectral L1SpectralLap2',...
    'file', 'L1SpectralLap2',...
    'enabled', false,...
    'spectral', true,...
    'priors', [false, true, true],...
    'options', struct('norms', [true, true, false], 'nonneg', false)...
);
admm_algorithms.spectralLap1 = struct(...
    'name', 'Spectral Lap1',...
    'file', 'Lap1',...
    'enabled', false,...
    'spectral', true,...
    'priors', [false, false, true],...
    'options', struct('norms', [true, false, true], 'nonneg', false)...
);
admm_algorithms.spectralLap2 = struct(...
    'name', 'Spectral Lap2',...
    'file', 'Lap2',...
    'enabled', false,...
    'spectral', true,...
    'priors', [false, false, true],...
    'options', struct('norms', [true, false, false], 'nonneg', false)...
);

admm_algorithms.colorL1L1 = struct(...
    'name', 'Color L1L1',...
    'file', 'L1L1',...
    'enabled', false,...
    'spectral', false,...
    'priors', [true, true, false],...
    'options', struct('norms', [true, true, false], 'nonneg', false)...
);
admm_algorithms.colorL2L2 = struct(...
    'name', 'Color L2L2',...
    'file', 'L2L2',...
    'enabled', false,...
    'spectral', false,...
    'priors', [true, true, false],...
    'options', struct('norms', [false, false, false], 'nonneg', false)...
);
admm_algorithms.colorL1L1NonNeg = struct(...
    'name', 'Color L1L1NonNeg',...
    'file', 'L1L1NonNeg',...
    'enabled', false,...
    'spectral', false,...
    'priors', [true, true, false],...
    'options', struct('norms', [true, true, false], 'nonneg', true)...
);
admm_algorithms.colorL2L2NonNeg = struct(...
    'name', 'Color L2L2NonNeg',...
    'file', 'L2L2NonNeg',...
    'enabled', false,...
    'spectral', false,...
    'priors', [true, true, false],...
    'options', struct('norms', [false, false, false], 'nonneg', true)...
);
admm_algorithms.colorL1NonNeg = struct(...
    'name', 'Color L1NonNeg',...
    'file', 'L1NonNeg',...
    'enabled', false,...
    'spectral', false,...
    'priors', [true, false, false],...
    'options', struct('norms', [true, false, false], 'nonneg', true)...
);
admm_algorithms.colorL2NonNeg = struct(...
    'name', 'Color L2NonNeg',...
    'file', 'L2NonNeg',...
    'enabled', false,...
    'spectral', false,...
    'priors', [true, false, false],...
    'options', struct('norms', [false, false, false], 'nonneg', true)...
);
admm_algorithms.colorL1 = struct(...
    'name', 'Color L1',...
    'file', 'L1',...
    'enabled', false,...
    'spectral', false,...
    'priors', [true, false, false],...
    'options', struct('norms', [true, false, false], 'nonneg', false)...
);
admm_algorithms.colorL2 = struct(...
    'name', 'Color L2',...
    'file', 'L2',...
    'enabled', false,...
    'spectral', false,...
    'priors', [true, false, false],...
    'options', struct('norms', [false, false, false], 'nonneg', false)...
);
admm_algorithms.colorL1SpatialLap2NonNeg = struct(...
    'name', 'Color L1SpatialLap2NonNeg',...
    'file', 'L1SpatialLap2NonNeg',...
    'enabled', false,...
    'spectral', false,...
    'priors', [true, false, true],...
    'options', struct('norms', [true, true, false], 'nonneg', true)...
);
admm_algorithms.colorL1SpectralLap2NonNeg = struct(...
    'name', 'Color L1SpectralLap2NonNeg',...
    'file', 'L1SpectralLap2NonNeg',...
    'enabled', false,...
    'spectral', false,...
    'priors', [false, true, true],...
    'options', struct('norms', [true, true, false], 'nonneg', true)...
);
admm_algorithms.colorLap1NonNeg = struct(...
    'name', 'Color Lap1NonNeg',...
    'file', 'Lap1NonNeg',...
    'enabled', false,...
    'spectral', false,...
    'priors', [false, false, true],...
    'options', struct('norms', [true, false, true], 'nonneg', true)...
);
admm_algorithms.colorLap2NonNeg = struct(...
    'name', 'Color Lap2NonNeg',...
    'file', 'Lap2NonNeg',...
    'enabled', false,...
    'spectral', false,...
    'priors', [false, false, true],...
    'options', struct('norms', [true, false, false], 'nonneg', true)...
);
admm_algorithms.colorL1SpatialLap2 = struct(...
    'name', 'Color L1SpatialLap2',...
    'file', 'L1SpatialLap2',...
    'enabled', false,...
    'spectral', false,...
    'priors', [true, false, true],...
    'options', struct('norms', [true, false, false], 'nonneg', false)...
);
admm_algorithms.colorL1SpectralLap2 = struct(...
    'name', 'Color L1SpectralLap2',...
    'file', 'L1SpectralLap2',...
    'enabled', false,...
    'spectral', false,...
    'priors', [false, true, true],...
    'options', struct('norms', [true, true, false], 'nonneg', false)...
);
admm_algorithms.colorLap1 = struct(...
    'name', 'Color Lap1',...
    'file', 'Lap1',...
    'enabled', false,...
    'spectral', false,...
    'priors', [false, false, true],...
    'options', struct('norms', [true, false, true], 'nonneg', false)...
);
admm_algorithms.colorLap2 = struct(...
    'name', 'Color Lap2',...
    'file', 'Lap2',...
    'enabled', false,...
    'spectral', false,...
    'priors', [false, false, true],...
    'options', struct('norms', [true, false, false], 'nonneg', false)...
);

% Demosaicking algorithms
demosaic_algorithms.bilinear = struct(...
    'name', 'Bilinear demosaicking',... % Bilinear interpolation for demosaicking
    'file', 'bilinear',...
    'enabled', true,...
    'fn', @bilinearDemosaic... % Function to call
);
demosaic_algorithms.matlab = struct(...
    'name', 'MATLAB demosaicking',... % MATLAB's built-in demosaic() function
    'file', 'MATLABdemosaic',...
    'enabled', true,...
    'fn', 'matlab'... % Special handling is required for this algorithm
);
demosaic_algorithms.ari = struct(...
    'name', 'ARI demosaicking',... % Adaptive residual interpolation
    'file', 'ARI',...
    'enabled', true,...
    'fn', 'ARI'... % Special handling is required for this algorithm
);

% RGB-based chromatic aberration correction
rgb_correction_algorithms.rudakova2014 = struct(...
    'name', 'warp-corrected',...
    'file', 'channelWarp',...
    'enabled', true...
);
rgb_correction_algorithms.sun2017 = struct(...
    'name', 'cct-corrected',...
    'file', 'cct',...
    'enabled', false...
);